﻿using System;
using GC_RF.DataAccess.Abstractions.Interfaces.Factories;
using GC_RF.DataAccess.Abstractions.Interfaces.Helpers;

namespace GC_RF.Domain.Abstractions.Services
{
	public abstract class BaseService
	{
		#region Properties

		protected IUnitOfWork UnitOfWork { get; private set; }

		protected IRepositoryFactory RepositoryFactory { get; private set; }

		#endregion

		#region Constructors

		protected BaseService(IUnitOfWork unitOfWork, IRepositoryFactory repositoryFactory)
		{
			if (unitOfWork == null)
				throw new ArgumentNullException(string.Format("unitOfWork"));
			UnitOfWork = unitOfWork;

			if (repositoryFactory == null)
				throw new ArgumentNullException(string.Format("repositoryFactory"));
			RepositoryFactory = repositoryFactory;
		}

		#endregion
	}
}
